<?php

namespace app\common\model;
use think\Model;

class Rent extends Model
{
    
  protected $autoWriteTimestamp = true;  
  
  public function agency()
  {
      return $this->hasOne('Agency','id','agency_id')->field('id,name');
  }
  
  public function user()
  {
      return $this->hasOne('User','id','user_id')->field('id,name');
  }
  
  public function contract()
  {
      return $this->hasMany('Contract','contract_no','contract_no');
  }
  
  
}
